package com.zc.im.mapper.user;

import com.zc.im.model.user.ZcAdminUser;
import com.zc.im.model.user.ZcAdminUserExample;
import com.zc.im.model.user.ZcAdminUserKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ZcAdminUserMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    int countByExample(ZcAdminUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    int deleteByExample(ZcAdminUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    @Delete({
        "delete from zc_admin_user",
        "where uid = #{uid,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(ZcAdminUserKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    @Insert({
        "insert into zc_admin_user (uid, phone, ",
        "pass, add_time, login_time, ",
        "add_ip, login_ip, user_name, ",
        "limits, group_id, ",
        "address, pic_head)",
        "values (#{uid,jdbcType=INTEGER}, #{phone,jdbcType=CHAR}, ",
        "#{pass,jdbcType=VARCHAR}, #{addTime,jdbcType=INTEGER}, #{loginTime,jdbcType=INTEGER}, ",
        "#{addIp,jdbcType=CHAR}, #{loginIp,jdbcType=CHAR}, #{userName,jdbcType=CHAR}, ",
        "#{limits,jdbcType=TINYINT}, #{groupId,jdbcType=TINYINT}, ",
        "#{address,jdbcType=CHAR}, #{picHead,jdbcType=VARCHAR})"
    })
    int insert(ZcAdminUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    int insertSelective(ZcAdminUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    List<ZcAdminUser> selectByExample(ZcAdminUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "uid, phone, pass, add_time, login_time, add_ip, login_ip, user_name, limits, ",
        "group_id, address, pic_head",
        "from zc_admin_user",
        "where uid = #{uid,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ZcAdminUser selectByPrimaryKey(ZcAdminUserKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") ZcAdminUser record, @Param("example") ZcAdminUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") ZcAdminUser record, @Param("example") ZcAdminUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(ZcAdminUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_admin_user
     *
     * @mbggenerated
     */
    @Update({
        "update zc_admin_user",
        "set phone = #{phone,jdbcType=CHAR},",
          "pass = #{pass,jdbcType=VARCHAR},",
          "add_time = #{addTime,jdbcType=INTEGER},",
          "login_time = #{loginTime,jdbcType=INTEGER},",
          "add_ip = #{addIp,jdbcType=CHAR},",
          "login_ip = #{loginIp,jdbcType=CHAR},",
          "user_name = #{userName,jdbcType=CHAR},",
          "limits = #{limits,jdbcType=TINYINT},",
          "group_id = #{groupId,jdbcType=TINYINT},",
          "address = #{address,jdbcType=CHAR},",
          "pic_head = #{picHead,jdbcType=VARCHAR}",
        "where uid = #{uid,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ZcAdminUser record);
}